﻿Imports System.IO

Public Class WatchAtivityOnDirectory

    Public Shared Sub Main()

        Dim n As String = "C:\Projetos\ArtNoi\Storage\ExperimentoWatchingDir_APAGAR"
        'Create two variables to use to set the time.
        Dim dtime1 As New DateTime(2002, 1, 3)
        Dim dtime2 As New DateTime(1999, 1, 1)

        'Create the directory.
        Try
            Directory.CreateDirectory(n)
        Catch e As IOException
            Console.WriteLine(e)
        End Try


        For i = 0 To 60
            Console.Clear()
            ' Print to console the results.
            Console.WriteLine("Creation Date: {0}", Directory.GetCreationTime(n))
            'Console.WriteLine("UTC creation Date: {0}", Directory.GetCreationTimeUtc(n))
            Console.WriteLine("Last write time: {0}", Directory.GetLastWriteTime(n))
            'Console.WriteLine("UTC last write time: {0}", Directory.GetLastWriteTimeUtc(n))
            Console.WriteLine("Last access time: {0}", Directory.GetLastAccessTime(n))
            'Console.WriteLine("UTC last access time: {0}", Directory.GetLastAccessTimeUtc(n))
            Threading.Thread.Sleep(1000)
        Next

    End Sub

End Class
